package com.sxjh.service.impl;

import com.sxjh.entity.User;
import com.sxjh.mapper.UserMapper;
import com.sxjh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Set;

@Service
public class UserServiceImpl implements UserService {

  @Autowired
  private UserMapper userMapper;

  @Override
  public User getUser(Integer id) {
    User user = userMapper.selectById(id);
//    if (user != null) {
//      Set<String> list = userMapper.permissions(id);
//      user.setPermissions(list);
//    }
    return user;
  }

  @Override
  public Set<String> roles(Integer id) {
    return userMapper.roles(id);
  }

}
